package com.microblogforsim.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.microblogforsim.R;

import java.util.ArrayList;

public class CommentAdapter extends BaseAdapter {
    private Context context;
    private ArrayList<String> data;

    public CommentAdapter(Context context, ArrayList<String> data) {
        this.context = context;
        this.data = data;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Log.d("cnm", "getView: cnm"+data.size());
        convertView = View.inflate(context, R.layout.item_comment,null);
        TextView tv_title = convertView.findViewById(R.id.item_comment_title);
        tv_title.setText(data.get(position));
        return convertView;
    }
}
